﻿@using mvcForum.Web.Helpers;
@{
	String ns = "mvcForum.Web";
	var items = Html.Navigation(Url, "TopNavigation");
}
<nav class="navbar navbar-default navbar-static-top" role="navigation">
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#">MVC Forum</a>
  </div>

  <div class="collapse navbar-collapse navbar-ex1-collapse">
    <ul class="nav navbar-nav navbar-right">
      <li>@Html.ActionLink(ForumHelper.GetLinkText("AdvancedSearch", null, ns), "index", "search", null, new { title = ForumHelper.GetString("AdvancedSearchTitle", null, ns) })</li>
    </ul>
    <ul class="nav navbar-nav">
@foreach (var item in items) {
	<li @if (item.Selected){<text>class="active"</text>}><a href="@item.URL">@item.Title</a></li>
}
    </ul>
	@using (Html.BeginForm("Index", "Search", new { area = "forum" }, FormMethod.Post, new { id = "search", role = "search", @class = "navbar-form navbar-right" })) {
      <div class="form-group">
		@Html.TextBox("Query", "", new { @class = "form-control", placeholder = ForumHelper.GetString("InitialSearchValue", null, ns), title = ForumHelper.GetString("SearchTitle", null, ns) })
      </div>
      <button type="submit" class="btn btn-default">@ForumHelper.GetLinkText("SearchButton", null, ns)</button>
	}
  </div>
</nav>
